#ifndef TRANSCODEVIDEO_H
#define TRANSCODEVIDEO_H

#include <QObject>
#include<QString>
#include<QDebug>
#include<QThread>
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavdevice/avdevice.h"
#include "libavfilter/avfilter.h"
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"
#include "libpostproc/postprocess.h"
#include "libswresample/swresample.h"
#include "libswscale/swscale.h"
}
class TransCodeVideo : public QThread
{
    Q_OBJECT
public:
    explicit TransCodeVideo();


    void openH264File(QString filepath);
    void tranceToMp4(QString filepath);
    int getVideolndex() const;
    void setVideolndex(int value);

    int getX() const;
    void setX(int value);

    void init();


private:
    AVFormatContext*inFormatContext;
    AVFormatContext*outFormatContext;
    AVOutputFormat*outputFormat;

    AVPacket*pkt;
    int videolndex;


    int x=0;

signals:


    void sendX(int x);
public slots:


};

#endif // TRANSCODEVIDEO_H
